<?php

class FeedbackController extends BaseController {

    public function addAction() {
        $data = [];
        $data['image_list'] = Request::getParams('imageList');
        $data['content'] = Request::getParams('content');
        $data['status'] = 0;
        $data['uid'] = $this->user_info['uid'];
        $data['add_time'] = $data['update_time'] = date('Y-m-d H:i:s');
        $result = self::model('feedback')->validata($data);
        if($result!==true) {
            Response::ajax(NORMAL_ERROR, $result);
        }
        if (self::model('feedback')->insert($data)) {
            Response::ajax(200, '提交反馈成功');
        }
        Response::ajax(NORMAL_ERROR, '提交反馈失败，请稍后重试');
    }

}
